# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=dockerscan
pkgver=59.590a844
_pyver=3.13
pkgrel=12
pkgdesc='Docker security analysis & hacking tools.'
groups=('blackarch' 'blackarch-scanner')
arch=('any')
url='https://github.com/cr0hn/dockerscan'
license=('BSD')
depends=('python' 'python-requests' 'python-pytest' 'python-click'
         'python-python-dxf' 'python-colorlog' 'python-booby-ng'
         'python-cryptography')
makedepends=('git' 'python-setuptools')
source=("git+https://github.com/cr0hn/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cd $pkgname

  sed -i 's/==.*//g' requirements.txt
}

build() {
  cd $pkgname

  python setup.py build
}

package() {
  cd $pkgname

  python setup.py install --root="$pkgdir" --prefix=/usr --skip-build

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.rst CHANGELOG
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  rm -rf "$pkgdir/usr/lib/python$_pyver/site-packages/test"
}

